package chapter3;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  两个圆，题目类似于先前那个,甚至比刚才的exc3_28还简单
 * Date:2021/4/1  
 * ***************************************************************
 */
public class exc3_29 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.println("Enter r1's center x- y-coordinates,"
				+ "and radius: ");
		double x1=input.nextDouble();
		double y1=input.nextDouble();
		double r1=input.nextDouble();
		System.out.println("Enter r2's center x- y-coordinates,"
				+ "and radius: ");
		double x2=input.nextDouble();
		double y2=input.nextDouble();
		double r2=input.nextDouble();
		
		double d=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		
		if( d<=Math.abs(r2-r1)) {
			
			System.out.println("r2 is inside r1.");  
			
		}else if( d<=r1+r2 ) {
			System.out.println("r2 overlaps r1.");
			
		}else {
			System.out.println("r2 does not overlaps r1.");
		}
		
	}
}
